<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box{
      width: 500px;
      height: 500px;
      border: 2px solid #000;
      margin-left: 100px;
      
      /* position: relative;
      left: 100px;
      top: 100px; */
    }
    .child{
      width: 100px;
      height: 100px;
      background: red;
      position: absolute;  /*绝对定位*/
      left: 200px;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="child"></div>
  </div>
</body>
</html>